#ifndef PATHFINDING_H
#define PATHFINDING_H

#include <vector>
#include <iostream>
#include <unordered_map>
#include <queue>

#include "object.h"
#include "entity.h"

using namespace std;

class Node {
    int x, y;
    vector<Node*> neighbors;
    bool passable;
public:
    Node(int initX, int initY): x(initX), y(initY) {
        passable = true;
    }
    void setNeighbors(vector<Node*> &nodes);
    vector<Node*> getNeighbors() {return neighbors;}

    int getX() {return x;}
    int getY() {return y;}
    bool isPassable() {return passable;}

    void setPassable(bool pass) {passable = pass;}
};

class Graph {
    vector<Node*> nodes;

    void connectNodes();

public:
    Graph(int, int, vector<Object*>*);
    void build(int, int);
    vector<Node*>* Getpath(int targetX, int targetY);
    void setObsticals(vector<Entity *>);
    Node* getNode(int x, int y);


};

#endif // PATHFINDING_H
